package com.golxen.framework.common.server.cross;


import com.golxen.framework.timers.TimerPlugin;

import java.util.concurrent.TimeUnit;

public class CrossAppPlugin {

    static CrossAppPlugin instance = null;

    public static void start() {
        if (instance != null) {
            return;
        }

        instance = new CrossAppPlugin();

//        TimerPlugin.registTimer(MgrDataSaveTask.class, 0, 60, TimeUnit.SECONDS,
//                Runtime.getRuntime().availableProcessors());
        TimerPlugin.registTimer(ConnectionCheckTask.class, 5, 5, TimeUnit.SECONDS);
    }

    public static boolean active() {
        return instance != null;
    }

}
